package com.bcxj.apiboss.config;

import com.bcxj.apiboss.interceptor.JwtInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
* ClassName: InterceptorConfig
* Package: com.bcxj.apipassenger.config
* Description: 
* @Author BCXJ
* @Create 2025/2/13 00:50 
* @Version 1.0   
* @Since 1.0   
*/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private StringRedisTemplate redisTemplate;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtInterceptor(redisTemplate))
                .addPathPatterns("/**")
                .excludePathPatterns("/admin/login");
    }
}

